'''
Created on Dec 4, 2010

@author: Nican
'''

import wx

class StartMenu(wx.BoxSizer):
    '''
    classdocs
    '''

    def __init__(self, parent):
        '''
        Constructor
        '''
        wx.BoxSizer.__init__(self, wx.HORIZONTAL)
        
        self.parent = parent
        self.startButton = wx.Button(parent, -1, "START")
        self.Add(self.startButton, 1, wx.EXPAND)
        
        self.startButton.Bind(wx.EVT_BUTTON, self.OnStart)
        
    def OnStart(self, e):
        
        if self.startButton.GetLabel() == "START":
            self.parent.startOctorotor()
            #Change the label text
            self.startButton.SetLabel("STOP")
        else:
            self.parent.stopOctoorotor()
            #Change the label text
            self.startButton.SetLabel("START")